/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.TimeClockServer.dtos;

import TimeRecording.TimeClockServer.enums.TxOrRx;
import java.util.Arrays;
import java.util.Date;

/**
 *
 * @author david
 */
public class TxRxBytes implements Cloneable {

    private byte[] message;
    private Date systemDate;
    private TxOrRx direction;

    public TxRxBytes(byte[] message, int messageLength,
            Date systemDate, TxOrRx direction) {
        
        this.message = Arrays.copyOf(message, messageLength);

        if (systemDate != null) {
            this.systemDate = systemDate;
        } else {
            this.systemDate = new Date();
        }
        this.direction = direction;
    }

    public TxOrRx getDirection() {
        return direction;
    }

    public void setDirection(TxOrRx direction) {
        this.direction = direction;
    }

    public byte[] getMessage() {
        return message;
    }

    public void setMessage(byte[] message) {
        this.message = message;
    }

    public Date getSystemDate() {
        return systemDate;
    }

    public void setSystemDate(Date systemDate) {
        this.systemDate = systemDate;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
